package com.yugao.fintech.antelope.pay.payment.controller.transfer;

import com.yugao.fintech.antelope.pay.common.annotation.PayCheck;
import com.yugao.fintech.antelope.pay.payment.model.rqrs.transfer.QueryTransferOrderRQ;
import com.yugao.fintech.antelope.pay.payment.model.rqrs.transfer.TransferOrderRQ;
import com.yugao.fintech.antelope.pay.payment.process.transfer.QueryTransferOrderProcess;
import com.yugao.fintech.antelope.pay.payment.process.transfer.TransferOrderProcess;
import com.yugao.fintech.antelope.pay.validation.PaySignGroup;
import com.yugao.fintech.framework.core.response.Resp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;

/**
 * 转账接口
 */
@Slf4j
@RestController
@RequestMapping("/pay/transfer")
public class TransferOrderController {
    @Autowired
    private TransferOrderProcess transferOrderProcess;
    @Autowired
    private QueryTransferOrderProcess queryTransferOrderProcess;


    /**
     * 转账
     */
    @PostMapping("/transferOrder")
    @PayCheck
    public Resp<?> transferOrder(@RequestBody @Validated(value = PaySignGroup.class) TransferOrderRQ bizRQ) {
        return transferOrderProcess.transferOrder(bizRQ);
    }

    /**
     * 查单接口
     */
    @GetMapping("/getTransferOrder")
    @PayCheck
    public Resp<?> getTransferOrder(@RequestParam @Validated(value = PaySignGroup.class) QueryTransferOrderRQ rq) {
        return queryTransferOrderProcess.queryTransferOrder(rq);
    }

}
